<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>paymsg</title>
    <link rel="stylesheet" type="text/css" href="../../../css/index.css" />
	<style>
		html,body{background: #f5f5f5;}
        #app-header{background-color:#FFF;}
        #title{font-size: 18px; font-weight: bold;}

		.pay-sta{width: 100%;}
		.pay-sta .img-box{width: 165px;height: 96px;margin: 90px auto 12px;}
		.pay-sta .img-box img{width: 100%;display: block;height: 100%;}
		.pay-sta .text{width: 100%;text-align: center;font-size: 18px;color: #333333;}
		.pay-sta .pay-type{font-size: 13px;color: #8E9194;text-align: center;padding-top: 10px;}
		.pay-sta .pay-num{font-size: 13px;color: #8E9194;text-align: center;}
		.pay-sta .btn-box{width: 100%;padding: 0 25px;box-sizing: border-box;margin-top: 40px}
		.pay-sta .btn-box .btn{font-size: 16px;text-align: center;line-height: 44px;height: 44px;margin: 20px 0;width: 100%;}
		.pay-sta .btn-box .btn.l{background:#FF9502;color: #FFFFFF;border-radius: 40px;}
		.pay-sta .btn-box .btn.r{background: #f5f5f5;color: #FF9502;border:1px solid #FF9502;box-sizing: border-box;border-radius: 40px;}
		.pay-sta .zhifu-btn{margin:100px 30px;background:#FF9502;border-radius:4px;text-align: center;line-height: 45px;font-size: 18px;color: #FFFFFF;}

	</style>
</head>
<body>

	<div id="vue">

        <div id="app-header">
            <div class="headbar">
                <div class="toolbar">
                    <div class="lf tool" tapmode="tapcss" onclick="backMenu(this);"><span class="back"></span></div>
                    <div class="title han_1"><span id="title">支付结果</span></div>
                    <div class="rt tool menu" id="menu" tapmode="tapcss" onclick="menuClick(this);"></div>
                </div>
            </div>
        </div>

		<!--支付成功-->
		<div class="pay-sta" v-if="sta == 1 && type != 'ruzhu'" >
			<div class="img-box"><img src="../../../image/main3/pay_sta1.png"/></div>
			<div class="text">订单支付成功</div>
			<div class="pay-type">支付方式:<i v-if="paytype == 'wxpay'">微信支付</i><i v-if="paytype == 'alipay'">支付宝支付</i><i v-if="paytype == 'dk'">优惠抵扣</i></div>
			<div class="pay-num">支付金额:¥<i v-text="price"></i></div>
			<div class="btn-box">
				<div class="btn l flex1" tapmode onclick="openOrder()">查看订单</div>
				<div class="btn r flex1" tapmode onclick="goIndex()">回到首页</div>
			</div>
		</div>

		<!--支付失败-->
		<div class="pay-sta" v-if="sta == 0 && type != 'ruzhu'">
			<div class="img-box"><img src="../../../image/main3/pay_sta2.png"/></div>
			<div class="text">订单支付失败</div>
			<div class="zhifu-btn" tapmode onclick="againPay()">重新支付</div>
		</div>

        <!--商家入驻结果 失败-->
        <div class="pay-sta" v-if="sta == 0 && type == 'ruzhu'">
			<div class="img-box"><img src="../../../image/main3/pay_sta2.png"/></div>
			<div class="text">订单支付失败</div>
			<div class="zhifu-btn" tapmode onclick="api.closeFrame();">返回</div>
		</div>

        <!--商家入驻结果 成功-->
        <div class="pay-sta" v-if="sta == 1 && type == 'ruzhu'" >
			<div class="img-box"><img src="../../../image/main3/pay_sta1.png"/></div>
			<div class="text">商家入驻支付成功</div>
			<div class="pay-type">支付方式:<i v-if="paytype == 'wxpay'">微信支付</i><i v-if="paytype == 'alipay'">支付宝支付</i><i v-if="paytype == 'dk'">优惠抵扣</i></div>
			<div class="pay-num">支付金额:¥<i v-text="price"></i></div>
			<div class="btn-box">
				<div class="btn l flex1" tapmode onclick="storeOk()">确定</div>
			</div>
		</div>

	</div>
<script type="text/javascript" src="../../../script/base.min.js"></script>
<script type="text/javascript">
    var _top = lanYun.setHeader('app-header');
    define(function (require, exports, module) {
        pageParam = api.pageParam;
        //var udata = lanYun.getUdata();
        //console.log(JSON.stringify(pageParam));

        lanYun.newVue('#vue',{
            sta:pageParam.sta,
            paytype:pageParam.paytype,
            price:pageParam.price,
            type:pageParam.type
        }, function(e) {

        });
        //-------华丽的分割线--------------------------------

        // 返回首页
        goIndex = function(){
            lanYun.event("toIndex");
            // if(udata.isnew == 1){
            //     getuserinfo();
            // }
        }

        // 商家入驻成功
        storeOk = function (){
            lanYun.event("upuser");
            api.closeToWin({name: 'root',animation:{subType:"from_left",duration:300}});
        }

        // 查看订单
        openOrder = function () {
	        lanYun.openWin('ordert/ordert_list.html', {
	            win:'win',
	           	title:'我的订单',
                menu:"<i style='color:#FF9502'>筛选</i>",
	            frameParam : {sta:2}
	        });
            setTimeout(function () {
                api.closeFrame();
            },300);
            // if(udata.isnew == 1){
            //     getuserinfo();
            // }
        };

        // 从新支付
        againPay = function (){
            lanYun.openWin('ordert/ordert_list.html', {
	            win:'win',
	           	title:'我的订单',
                menu:"<i style='color:#FF9502'>筛选</i>",
	            frameParam : {sta:1}
	        });
            setTimeout(function () {
                api.closeFrame();
            },300);

            //console.log(pageParam.topframeName);
			// lanYun.get('OrderPush/restPayOrder?orderid=' + pageParam.orderid ,function (ret) {
            //     api.execScript({ frameName:pageParam.topframeName, script:'lyFrameCallBack('+JSON.stringify(ret)+');'});
            //     api.closeFrame();
			// },2)
		}

        //页面关闭方法
        backMenu = function (tis){
            api.closeWin();
        }

        //获取用户信息
        getuserinfo = function (){
            lanYun.get('User/getinfo' ,function (ret) {
                //console.log(JSON.stringify(ret));
                if(ret.errcode == 0){
                    lanYun.updateUdata(ret.data, 0);
                    api.execScript({name: 'root',frameName:'main0',script:'setisnew();'});
                }
            },0);
        }

    });

</script>
</body>
</html>
